﻿IF OBJECT_ID('TraFaXueMingXi', 'U') IS NULL
    CREATE TABLE dbo.TraFaXueMingXi (
        Id                      BIGINT NOT NULL,      -- Id
        xueYeId                 BIGINT NULL,                          -- 血液Id
        traFaXueId              NVARCHAR(255) NULL,                   -- 发血主表Id
        traPeiXueMingXiId       BIGINT NULL,                          -- 配血明细Id
        shiFouTuiXue            BIT NULL,                             -- 是否退血
        CONSTRAINT pk_TraFaXueMingXi PRIMARY KEY CLUSTERED (Id)
    );
GO

-- 添加表和列注释
IF OBJECT_ID('TraFaXueMingXi', 'U') IS NOT NULL
BEGIN
    EXEC sp_addcomment 'TraFaXueMingXi', '临床发血明细表', '', '';
    EXEC sp_addcomment 'TraFaXueMingXi', '', 'Id', 'Id';
    EXEC sp_addcomment 'TraFaXueMingXi', '', 'xueYeId', '血液Id';
    EXEC sp_addcomment 'TraFaXueMingXi', '', 'traFaXueId', '发血主表Id';
    EXEC sp_addcomment 'TraFaXueMingXi', '', 'traPeiXueMingXiId', '配血明细Id';
    EXEC sp_addcomment 'TraFaXueMingXi', '', 'shiFouTuiXue', '是否退血';
END
GO